// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ConsoleHostArguments.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace ConsoleHost
{
    using System.Collections.Generic;

    using CmdLine;

    /// <summary>
    /// Representation of the command line arguments for ImHost
    /// </summary>
    [CommandLineArguments(Program = ProgramName, Title = Title, Description = Description)]
    public class ConsoleHostArguments
    {
        /// <summary>
        /// The application description
        /// </summary>
        public const string Description = "Host app for testing and debugging the Intelligent Motion subsystem.";

        /// <summary>
        /// The app title
        /// </summary>
        public const string Title = "Agent Runtime Host";

        /// <summary>
        /// The application name
        /// </summary>
        public const string ProgramName = "ConsoleHost";

        /// <summary>
        /// Robot config folder used for robot configuration.
        /// </summary>
        public const string RobotConfigFolderString = "robotconfigfolder";

        /// <summary>
        /// Robot config base folder.
        /// </summary>
        public const string RobotConfigBaseFolder = @"\\robofile\baker\Shared\Users\roboim\RobotConfig";

        /// <summary>
        /// Initializes a new instance of the ConsoleHostArguments class.
        /// </summary>
        public ConsoleHostArguments()
        {
            this.Agents = new List<string>();
        }

        /// <summary>
        /// Gets or sets the pathname to an XSLT to be applied.
        /// </summary>
        [CommandLineParameter(Command = "t", Name = "transform", Required = false, Default = @"Transforms\Common.xslt",
            Description = "Specifies the pathname to an XSLT transform to be applied to the manifest.", ValueExample = "/t:<path>")]
        public string Transform { get; set; }

        /// <summary>
        /// Gets or sets the set of substitutions to be made during transformation.
        /// </summary>
        [CommandLineParameter(Command = "s", Name = "substitute", Required = false,
            Description = "Substitution values for tokens in the form $foo within the manifest.", ValueExample = "<name>=<value>[,<name>=<value>,...]")]
        public string Substitute { get; set; }

        /// <summary>
        /// Gets or sets the robot config folder
        /// </summary>
        [CommandLineParameter(Command = "r", Name = RobotConfigFolderString, Required = false,
            Description = "Folder for robot configuration data.", ValueExample = @"/r:<robotconfigfolderpath>")]
        public string RobotConfigFolder { get; set; }

        /// <summary>
        /// Gets or sets the pathname to our manifest file.
        /// </summary>
        [CommandLineParameter(Name = "manifest", Required = false, ParameterIndex = 1,
            Description = "Specifies the pathname for the Agent Runtime configuration file.", ValueExample = "Manifests\\SLAMPlayback.xml")]
        public string Manifest { get; set; }

        /// <summary>
        /// Gets or sets a list of agents to be activated at startup.
        /// </summary>
        [CommandLineParameter(Command = "a", Name = "agent", Required = false, 
            Description = "Name an agent to activate (can specify more than one)", ValueExample = "/a:<agent-name>")]
        public List<string> Agents { get; set; }

        /// <summary>
        /// Gets or sets the name of the UI agent, if different than the default.
        /// </summary>
        [CommandLineParameter(Command = "v", Name = "visualization", Default = "UserInterface", Required = false,
            Description = "Specifies the name of the visualization agent. Defaults to \"UserInterface\".", ValueExample = "/v:UserInterface")
        ]
        public string Visualization { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the pipeline should run in offline mode.
        /// </summary>
        [CommandLineParameter(Command = "o", Name = "offline", Required = false, Default = false, 
            Description = "Indicates that the pipeline should run in offline mode, such that all messages get to be processed and no messages are dropped. The default behavior is online mode (real-time).", ValueExample = "/o")
        ]
        public bool OfflineMode { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the performance counters should be reinstalled. 
        /// </summary>
        [CommandLineParameter(Command = "p", Name = "performance counters", Required = false, Default = false,
            Description = "Reinstalls the perf counters. Needs to run with admin credentials.", ValueExample = "/p")
        ]
        public bool InstallPerformanceCounters { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether help was requested.
        /// </summary>
        [CommandLineParameter(Command = "?", Default = false, Description = "Show Help", Name = "Help", IsHelp = true)]
        public bool Help { get; set; }
    }
}
